/*
 * @Descripttion: 文件说明
 * @version: V1.0
 * @Author: GW
 * @Date: 2021-07-29 10:40:41
 * @LastEditors: GW
 * @LastEditTime: 2021-11-04 14:38:26
 */
import { axios } from "../../utils/request";

const api = {
    PageList: "/erp/currency/pageList",
    List: "/erp/currency/getAll",
    getDetail: "/erp/currency/getDetailList",
    Save: "/erp/currency/save",
    DELETE: "/erp/currency/delete",
    getDetailId: "/erp/currency/getCurrencyDetail",//根据id获取币种详情
};

/**
 * 获取币种设置列表
 */
export function pageList (parameter) {
    return axios({
        url: api.PageList,
        method: "get",
        params: parameter,
        timeout: 500000,
    });
}

/**
 * 根据id获取币种详情
 */
export function getCurrencyDetailId (data) {
    return axios({
        url: api.getDetailId,
        method: "get",
        params: data,
        timeout: 500000,
    });
}

/**
 * 获取币种设置列表
 */
export function list (parameter) {
    return axios({
        url: api.List,
        method: "get",
        params: parameter,
        timeout: 500000,
    });
}

/**
 * 新增/修改币种设置
 * @param {*} data
 */
export function save (data) {
    console.log(data);
    return axios({
        url: api.Save,
        isLoading: true,
        method: "post",
        data: data
    });
}

/**
 * 删除币种设置
 */
export function deleteCurrency (data) {
    return axios({
        url: api.DELETE,
        method: "post",
        data: data
    });
}

/**
 * 获取明细
 */
export function getDetail (parameter) {
    return axios({
        url: api.getDetail,
        method: "get",
        params: parameter,
        timeout: 500000,
    });
}